function show(elements3,int_elements3,out_elements3,coordinates,AvS,u,...
                 int_lambda,int_mu,out_lambda,out_mu);
%SHOW  Plots two-dimensional solution
%    SHOW(ELEMENTS3,ELEMENTS4,COORDINATES,AVS,U) plots the
%    strained mesh and visualizes the stresses in grey tones.
%
%    The variable AVS is previously determined by the function <avmatrix.m>.

for i=1:size(coordinates,1)
    if any(any(int_elements3==i))
       AvC(i)=(int_mu/(24*(int_mu+int_lambda)^2)+1/(8*int_mu))*(AvS(i,1)+...
        AvS(i,4))^2+1/(2*int_mu)*(AvS(2)^2-AvS(1)*AvS(4));
    else 
        AvC(i)=(out_mu/(24*(out_mu+out_lambda)^2)+1/(8*out_mu))*(AvS(i,1)+...
        AvS(i,4))^2+1/(2*int_mu)*(AvS(2)^2-AvS(1)*AvS(4));
    end
end
factor=1;
figure(1)
colormap(1-gray);

trisurf(elements3,factor*u(1:2:size(u,1))+coordinates(:,1), ...
    factor*u(2:2:size(u,1))+coordinates(:,2), ...
    zeros(size(coordinates,1),1), AvC, 'facecolor','interp');
hold on

% trisurf(elements4,factor*u(1:2:size(u,1))+coordinates(:,1), ...
%     factor*u(2:2:size(u,1))+coordinates(:,2), ...
%     zeros(size(coordinates,1),1), AvC, 'facecolor','interp');
 view(0,90)
hold off
colorbar('vert')
  



